//
//  YZCollectionViewWaterfallLayout.h
//  CollectionTest
//
//  Created by yuze on 2016/10/20.
//  Copyright © 2016年 yuze. All rights reserved.
//

#import <UIKit/UIKit.h>

@class  YZCollectionViewWaterfallLayout;

@protocol WaterfallLayoutDelegate <NSObject>

@required
//决定cell的高度,必须实现方法
- (CGFloat)waterfallLayout:(YZCollectionViewWaterfallLayout *)waterFlowLayout heightForRowAtIndex:(NSInteger)index itemWidth:(CGFloat)width;

@optional
//决定cell的列数
- (NSInteger)cloumnCountInWaterfallLayout:(YZCollectionViewWaterfallLayout *)waterFlowLayout;

//决定cell 的列的距离
- (CGFloat)columMarginInWaterfallLayout:(YZCollectionViewWaterfallLayout *)waterFlowLayout;

//决定cell 的行的距离
- (CGFloat)rowMarginInWaterfallLayout:(YZCollectionViewWaterfallLayout *)waterFlowLayout;

//决定cell 的边缘距
- (UIEdgeInsets)edgeInsetInWaterfallLayout:(YZCollectionViewWaterfallLayout *)waterFlowLayout;

@end

@interface YZCollectionViewWaterfallLayout : UICollectionViewLayout

@property (nonatomic,assign) id<WaterfallLayoutDelegate> delegate;

- (NSInteger)columCount;
- (CGFloat)columMargin;
- (CGFloat)rowMargin;
- (UIEdgeInsets)defaultEdgeInsets;

@end
